package utils

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

type ResponseUtils struct {
}

func GetAllBody(ctx *gin.Context, body *map[string]interface{}) {
	ctx.ShouldBind(&body)
}
func Ok(ctx *gin.Context, data interface{}) {
	ctx.JSON(200, gin.H{"success": true, "code": 200, "data": data})
}
func FailRes(ctx *gin.Context, message string) {
	ctx.JSON(500, gin.H{
		"success": false,
		"code":    500,
		"message": message,
		"data":    nil})
}

func DD(a any, params ...any) {
	fmt.Sprintf(a.(string), params)
}
